package cn.livingCloud.dto;

import cn.livingCloud.entity.core.Case;
import cn.livingCloud.utils.DateUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by DingJie on 2016/6/3.
 */
public class CaseFormDto {
    private Float locationX;
    private Float locationY;
    private String uuid;
    private String addressDescription;
    private String phone;
    private String createDateTime;
    //案件图片
    private List<CaseImageDto> imageList = new ArrayList<>();
    //创建人(粉丝)
    private String creatorUuid;
    private MemberDto creator;

    public CaseFormDto() {
    }

    public CaseFormDto(Case item) {
        this.creatorUuid = item.getCreatorUuid();
        this.addressDescription = item.getAddressDescription();
        this.locationX = item.getLocationX();
        this.locationY = item.getLocationY();
        this.phone = item.getPhone();
        this.uuid = item.getUuid();
        this.createDateTime = DateUtils.toDateText(item.getCreateDateTime()
                , DateUtils.DEFAULT_DATE_TIME_FORMAT);
        this.creator = new MemberDto(item.getMember());
//        List<CaseImage> imageList = item.getImageList();
//        for (CaseImage caseImage : imageList) {
//            this.imageList.add(new CaseImageDto(caseImage));
//        }
    }

//    public void loadImageList(Case aCase) {
//        for (CaseImage caseImage : aCase.getImageList()) {
//            imageList.add(new CaseImageDto(caseImage));
//        }
//    }

    public List<CaseImageDto> getImageList() {
        return imageList;
    }

    public void setImageList(List<CaseImageDto> imageList) {
        this.imageList = imageList;
    }

    public Float getLocationX() {
        return locationX;
    }

    public void setLocationX(Float locationX) {
        this.locationX = locationX;
    }

    public Float getLocationY() {
        return locationY;
    }

    public void setLocationY(Float locationY) {
        this.locationY = locationY;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    public String getAddressDescription() {
        return addressDescription;
    }

    public void setAddressDescription(String addressDescription) {
        this.addressDescription = addressDescription;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(String createDateTime) {
        this.createDateTime = createDateTime;
    }

    public String getCreatorUuid() {
        return creatorUuid;
    }

    public void setCreatorUuid(String creatorUuid) {
        this.creatorUuid = creatorUuid;
    }

    public MemberDto getCreator() {
        return creator;
    }

    public void setCreator(MemberDto creator) {
        this.creator = creator;
    }
}
